<?php
class Module_trunks extends MY_Library {

function __construct(){
	parent::__construct();
	
	$this->PACKAGE->routing->load->library('trunks/trunks');
}

public function show_status_desc($trunk_id,$trunk_type)
{
	$trunk = $this->PACKAGE->routing->trunks->get_trunk_as_array_by_id($trunk_id,$trunk_type);
	
	if($trunk['carrier_status'] == 0)
	{
		$desc = lang('term_carrier_disabled');
	}
	if($trunk['trunk_status'] == 0)
	{
		$desc = lang('term_trunk_disabled');
	}
	else
	{
		$desc = "";
	}
	
	return $desc;
}

public function show_status_msg($trunk_id,$trunk_type)
{
	$trunk = $this->PACKAGE->routing->trunks->get_trunk_as_array_by_id($trunk_id,$trunk_type);
	
	if($trunk['carrier_status'] == 0)
	{
		$msg = "[".lang('term_blocked')."]";
	}
	elseif($trunk['trunk_status'] == 0)
	{
		$msg = "[".lang('term_blocked')."]";
	}	
	else
	{
		$msg = "";
	}
	
	return $msg;
}

}
?>